/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef AGGRAVATED_SCHEDULE_PERFORMER_H
#define AGGRAVATED_SCHEDULE_PERFORMER_H
#include "common/schedule_decision/queue/aggregated_queue.h"
#include "schedule_performer.h"

namespace functionsystem::schedule_decision {

struct SelectResult {
    int32_t code;
    std::string failReason;
    std::shared_ptr<std::deque<ScheduleResult>> successSelectResult;
};

class AggregatedSchedulePerformer : public SchedulePerformer {
public:
    explicit AggregatedSchedulePerformer(const AllocateType &type) : SchedulePerformer(type){};
    ~AggregatedSchedulePerformer() override = default;

    virtual std::shared_ptr<std::deque<ScheduleResult>> DoSchedule(
        const std::shared_ptr<schedule_framework::PreAllocatedContext> &context,
        const resource_view::ResourceViewInfo &resourceInfo, const std::shared_ptr<AggregatedItem> &aggregatedItem);

    std::shared_ptr<std::deque<ScheduleResult>> DoMultiSchedule(
        const std::shared_ptr<schedule_framework::PreAllocatedContext> &context,
        const resource_view::ResourceViewInfo &resourceInfo,
        const std::shared_ptr<std::deque<std::shared_ptr<InstanceItem>>> &items);
};
}  // namespace functionsystem::schedule_decision

#endif  // AGGRAVATED_SCHEDULE_PERFORMER_H
